import 'dart:io';

import 'package:device_info_plus/device_info_plus.dart';
import 'package:package_info_plus/package_info_plus.dart';

import '../../utils/log_utils.dart';

class SystemConfig {
  static PackageInfo packageInfo = PackageInfo(appName: "", packageName: "", version: "0.01", buildNumber: '1');
  static AndroidDeviceInfo? androidInfo;
  static IosDeviceInfo? iosInfo;

  static Future<void> initSystemInfo() async {
    packageInfo = await PackageInfo.fromPlatform();
    DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
    if (Platform.isAndroid) {
      androidInfo = await deviceInfo.androidInfo;
    } else if (Platform.isIOS) {
      iosInfo = await deviceInfo.iosInfo;
    }

    var map = androidInfo?.toMap();
    LogUtils.d(map.toString());
  }
}
